package web_view

import (
	"github.com/shopspring/decimal"
	"time"

	"gorm.io/gorm"
)

const TableNameOrderDetailReport = "order_detail_report"

// OrderDetailReport mapped from table <order_detail_report>
type OrderDetailReport struct {
	ID                int64           `gorm:"column:id;type:INTEGER" json:"id"`
	OrderCode         string          `gorm:"column:order_code;type:TEXT" json:"order_code"`
	OrderLineNum      int64           `gorm:"column:order_line_num;type:INTEGER" json:"order_line_num"`
	ProductName       string          `gorm:"column:product_name;type:TEXT" json:"product_name"`
	ProductCode       string          `gorm:"column:product_code;type:TEXT" json:"product_code"`
	ProductEn         string          `gorm:"column:product_en;type:TEXT" json:"product_en"`
	Formula           string          `gorm:"column:formula;type:TEXT" json:"formula"`
	StorageType       string          `gorm:"column:storage_type;type:TEXT" json:"storage_type"`
	LotNum            string          `gorm:"column:lot_num;type:TEXT" json:"lot_num"`
	ProductDate       string          `gorm:"column:product_date;type:text" json:"product_date"`
	ExpireDate        string          `gorm:"column:expire_date;type:text" json:"expire_date"`
	Count             decimal.Decimal `gorm:"column:count;type:DECIMAL" json:"count"`
	Unit              string          `gorm:"column:unit;type:TEXT" json:"unit"`
	Specifications    string          `gorm:"column:specifications;type:TEXT" json:"specifications"`
	Manufacturer      string          `gorm:"column:manufacturer;type:TEXT" json:"manufacturer"`
	ApprovalNum       string          `gorm:"column:approval_num;type:TEXT" json:"approval_num"`
	PermitHolder      string          `gorm:"column:permit_holder;type:TEXT" json:"permit_holder"`
	CreatedAt         time.Time       `gorm:"column:created_at;type:DATETIME" json:"created_at"`
	UpdatedAt         time.Time       `gorm:"column:updated_at;type:DATETIME" json:"updated_at"`
	DeletedAt         gorm.DeletedAt  `gorm:"column:deleted_at;type:DATETIME" json:"deleted_at"`
	CreatedBy         string          `gorm:"column:created_by;type:TEXT" json:"created_by"`
	UpdatedBy         string          `gorm:"column:updated_by;type:TEXT" json:"updated_by"`
	Route             string          `gorm:"column:route;type:TEXT" json:"route"`
	ApprovalValidTime string          `gorm:"column:approval_valid_time;type:TEXT" json:"approval_valid_time"`
	PriorityLevel     string          `gorm:"column:priority_level;type:TEXT" json:"priority_level"`
	OrderStatus       string          `gorm:"column:order_status;type:TEXT" json:"order_status"`
	TransSn           string          `gorm:"column:trans_sn;type:TEXT" json:"trans_sn"`
	CustomerName      string          `gorm:"column:customer_name;type:TEXT" json:"customer_name"`
	Addr              string          `gorm:"column:addr;type:TEXT" json:"addr"`
	CarrierName       string          `gorm:"column:carrier_name;type:TEXT" json:"carrier_name"`
	CarSn             string          `gorm:"column:car_sn;type:TEXT" json:"car_sn"`
	DriverName        string          `gorm:"column:driver_name;type:TEXT" json:"driver_name"`
	TrusteeName       string          `gorm:"column:trustee_name;type:TEXT" json:"trustee_name"`
}

// TableName OrderDetailReport's table name
func (*OrderDetailReport) TableName() string {
	return TableNameOrderDetailReport
}
